<template>
    <div class="container" @click="handleClick">
      <div class="wrapper">
        <swiper :options="swiperOption">
          <!-- slides -->
          <swiper-slide v-for="(item,index) of imgs" :key="index">
            <img :src="item" class="swiper-img"/>
          </swiper-slide>

          <div class="swiper-pagination"  slot="pagination"></div>
        </swiper>
      </div>
    </div>
</template>

<script>
export default {
  props: {
    imgs: {
      type: Array,
      default () {
        return ['/static/images/detail-1-1.jpg', '/static/images/detail-1-2.jpg']
      }
    }
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleClick: function () {
      this.$emit('close')
    }
  },
  components: {},
  computed: {}
}
</script>

<style lang="stylus" scoped >
.container >>> .swiper-container
  overflow: inherit
.container
  display: flex
  flex-direction:column
  justify-content: center
  z-index :99
  position :fixed
  top :0
  left :0
  right :0
  bottom : 0
  background-color :#000
  .wrapper
    height :0
    width :100%
    padding-bottom :68.5%
    background-color :#fff
    .swiper-img
      width :100%
    .swiper-pagination
      bottom:-1rem
      color:#fff

</style>
